-- card: 19072 from stack: in.3 -- bmap block id: 0 -- flags: 4000 -- background id: 3241 -- name: AuxActive ----- HyperTalk script ----- on Install get ChooseTargetStack() InstallResource XFCN,AuxActive,it end Install -- part 1 (button) -- low flags: 00 -- high flags: A003 -- rect: left=80 top=300 right=322 bottom=180 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: OS Snitcher ----- HyperTalk script ----- on mouseUp if AuxActive() then answer "A/UX is running." else answer "Macintosh OS is running." end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: A003 -- rect: left=299 top=300 right=322 bottom=438 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Show Pascal Source ----- HyperTalk script ----- on mouseUp set the visible of card field 1 to not the visible of card field 1 if the visible of card field 1 is true then set the name of me to "Hide Pascal Source" else set the name of me to "Show Pascal Source" end mouseUp -- part 3 (field) -- low flags: 81 -- high flags: 2007 -- rect: left=12 top=26 right=298 bottom=491 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 22 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Source -- part contents for background part 16 ----- text ----- AUXACTIVE XFCN version 1.0 Kevin Calhoun AuxActive returns true if HyperCard is running under A/UX and false if HyperCard is running under the Macintosh OS. This information is especially useful to developers who rely on XCMD's that may not work under A/UX. Compatibility of the Dartmouth XCMD's with A/UX: SerialHandler is known not to work under A/UX, PrintField and TextStream have yet to be tested, and the remainder of the XCMD's and XFCN's in this stack have been tested under A/UX only cursorily. They appear to work, but we recommend that you subject them to your own testing before relying on them for use under any operating system other than Macintosh OS. -- part contents for card part 3 ----- text ----- UNIT AUX; { XFCN AuxActive © 1989 by the Trustees of Dartmouth College } { Written by Kevin Calhoun } { This source compatible with MPW Pascal 3.0 } (* Pascal AuxActive.p Link -m ENTRYPOINT ∂ -o "YourFile" ∂ -rt XFCN=1967 ∂ -sn Main=AuxActive ∂ AuxActive.p.o ∂ "{Libraries}"interface.o ∂ "{PLibraries}"Paslib.o ∂ "{Libraries}"HyperXLib.o *) {$R-} INTERFACE USES ToolUtils, HyperXCmd; PROCEDURE Entrypoint(paramPtr: XCMDPtr); IMPLEMENTATION PROCEDURE CheckForAUX(paramPtr: XCMDPtr); FORWARD; PROCEDURE Entrypoint(paramPtr: XCMDPtr); BEGIN CheckForAUX(paramPtr); END; FUNCTION AuxActive: BOOLEAN; { If A/UX is active, bit 9 of the word at $B22 is set. If Mac OS is active, that bit is clear. } CONST HWCfgFlags = $B22; BEGIN AuxActive := BitTst(Ptr(HWCfgFlags),6); { "6" is not a typo! The toolbox BitTst routine takes an offset from the high order bit of the byte pointed to by the first param. } END; PROCEDURE CheckForAUX(paramPtr: XCMDPtr); VAR s: Str255; BEGIN BoolToStr(paramPtr,AuxActive,s); paramPtr^.returnValue := PasToZero(paramPtr,s); END; END.